<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }
        .c1{
            background-color: red;
            position: relative;
            left: 50px;
            top: 50px;
            z-index: -1;/*越小在屏幕上越小*/
        }

        .c2{
            /* background-color: rgba(0, 0, 255, 0.5); 1内容不会透明*/
            opacity: 0.5;
            font-size:30px;
            background-color: darkturquoise;/*2，内容也会透明*/
        }
    </style>
</head>
<body>
    <div class="c1"></div>
    <div class="c2">
        hello
    </div>
</body>
</html>